#if !defined(PIECES_H)
#define PIECES_H
#include <map>
#include "Board.h"
#include "Piece.h"
#include "King.h"
#include "Queen.h"
#include "Rook.h"
#include "Knight.h"
#include "Bishop.h"
#include "Pawn.h"

///@brief A class that instantiates and/or points to each piece on a chess board. 
/// This class is used by the ChessGame to hold Piece objects. 
class Pieces {

	public:
		/// Empty Constructor
		Pieces(Board* board, char * action);
		/// Alloc piece objects on heap (initially pointing to nothing)
		Pieces(Board* board);
		~Pieces();
		/// Sets appropriate member to piece
		void AddPiece(Piece* piece);
		Piece* AddPiece(std::string type,std::string color, int row, int column);
		//King Getters
		Piece* gWhiteKing();
		Piece* gBlackKing();
	
		//Queen Getters
		Piece* gWhiteQueen();
		Piece* gBlackQueen();
	
		//Rook Getters
		Piece* gWhiteRook0();
		Piece* gWhiteRook1();
		Piece* gBlackRook0();
		Piece* gBlackRook1();
	
		//Knight Getters
		Piece* gWhiteKnight0();
		Piece* gWhiteKnight1();
		Piece* gBlackKnight0();
		Piece* gBlackKnight1();
	
		//Bishop Getters
		Piece* gWhiteBishop0();
		Piece* gWhiteBishop1();
		Piece* gBlackBishop0();
		Piece* gBlackBishop1();
	
		//Pawn Getters
		Piece* gWhitePawn0();
		Piece* gWhitePawn1();
		Piece* gWhitePawn2();
		Piece* gWhitePawn3();
		Piece* gWhitePawn4();
		Piece* gWhitePawn5();
		Piece* gWhitePawn6();
		Piece* gWhitePawn7();

		Piece* gBlackPawn0();
		Piece* gBlackPawn1();
		Piece* gBlackPawn2();
		Piece* gBlackPawn3();
		Piece* gBlackPawn4();
		Piece* gBlackPawn5();
		Piece* gBlackPawn6();
		Piece* gBlackPawn7();

		int bRookCount;
		int bBishopCount;
		int bKnightCount;
		int bPawnCount;
		int wRookCount;
		int wBishopCount;
		int wKnightCount;
		int wPawnCount;
		struct second_deleter
		{
			template <typename T>
			void operator()(const T& pX) const
			{
				delete pX.second;
			}
		};

	private:
		Board * board;
		std::map<std::string, Piece*> piecesMap;


};

#endif


